package com.example.utils;

import com.example.daoman.User;
import org.apache.shiro.SecurityUtils;

public class GetSession {

    //    获取安全数据的方法
    public static User get() {
        try {
            User principal = (User) SecurityUtils.getSubject().getPrincipal();
            return principal;
        }catch (Exception e){
            return null;
        }
    }
}
